import Mock from 'mockjs';

/**
 * get 请求 模拟通过ID获取用户数据
 */
Mock.mock(/\/api\/getUserById(.*)/, 'get', () => {
	return {
		introduction: 'I am an editor',
		avatar: 'http://r74mocdcd.hd-bkt.clouddn.com/yushi/logo.png',
		name: 'yushi'
	}
})

/**
 * 获取左侧树
 */
Mock.mock(/\/api\/getNavTree/, 'get', () => {
	return [{
		label: '岩层模型',
		type: 'checkbox',
		id: 1,
		icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/dicengjiagou.png',
		checked_icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/dicengjiagou-selected.png',
		children: [
			{
				label: '岩层1',
				type: 'checkbox',
				id: 2,
			},
			{
				label: '岩层2',
				type: 'checkbox',
				id: 3,
			},
			{
				label: '岩层3',
				type: 'checkbox',
				id: 4,
			}
		]
	},
		{
			label: '施工模型',
			type: 'radio',
			id: 5,
			icon: 'http://r74mocdcd.hd-bkt.clouddn.com/yushi/fenzhi.png',
			checked_icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/fenzhi-selected.png',
			children: [
				{
					label: '施工阶段1',
					type: 'radio',
					id: 6,
				},
				{
					label: '施工阶段2',
					type: 'radio',
					id: 7,
				},
				{
					label: '施工阶段3',
					type: 'radio',
					id: 8,
				}
			]
		},
		{
			label: '计算机网络模型',
			type: 'checkbox',
			id: 9,
			icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/dicengjiagou.png',
			checked_icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/dicengjiagou-selected.png',
			children: [
				{
					label: '计算机网络模型1',
					type: 'checkbox',
					id: 10,
				},
				{
					label: '计算机网络模型2',
					type: 'checkbox',
					id: 11,
				},
				{
					label: '计算机网络模型3',
					type: 'checkbox',
					id: 12,
				}
			]
		},
		{
			label: '切片云图',
			type: 'radio',
			id: 13,
			icon: 'http://r74mocdcd.hd-bkt.clouddn.com/yushi/fenzhi.png',
			checked_icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/fenzhi-selected.png',
			children: [
				{
					label: '切片云图1',
					type: 'checkbox',
					id: 14,
				},
				{
					label: '切片云图2',
					type: 'checkbox',
					id: 15,
				},
				{
					label: '切片云图3',
					type: 'checkbox',
					id: 16,
				}
			]
		},
		{
			label: '切片等值线图',
			type: 'radio',
			id: 17,
			icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/dicengjiagou.png',
			checked_icon:'http://r74mocdcd.hd-bkt.clouddn.com/yushi/dicengjiagou-selected.png',
			children: [
				{
					label: '切片等值线图1',
					type: 'checkbox',
					id: 18,
				},
				{
					label: '切片等值线图2',
					type: 'checkbox',
					id: 19,
				},
				{
					label: '切片等值线图3',
					type: 'checkbox',
					id: 20,
				}
			]
		},
	]
})
/**
 * get 请求 模拟通过ID获取用户数据
 */
Mock.mock(/\/api\/getSliceData(.*)/, 'get', () => {
	return {
		// 工况
		work_condition:[
			{
				value:1,
				label:'工况1'
			},
			{
				value:2,
				label:'工况2'
			}
		],
		work_condition_value:1,
		result_type_arr:['Dx','Dy','Dz','Dxyz','Sig1','Sig2','Sig3','Pla','Sxx','Syy','Szz'],
		result_type:'Dx',// 结果类型
		pingHua:true,// 平滑塑性区
		show_Wy:true,// 显示位移矢量
		show_Dz:true,// 显示等值线
		show_slice:true,// 显示切片
		slice_position:2000,// 切片位置
		fa_XL:'X',// 法向向量
		reverse_direction:true,// 反向
		slice_num:40,
		slice_range:[0,2000],
		name:'',
		slice_pic:false,// 切片云图
		slice_dzx:false// 切片等值线
	}
})
Mock.mock(/\/api\/saveSliceData(.*)/, 'post', () => {
	return {
		code:0,
		message:'保存成功'
	}
});

Mock.mock(/\/api\/getSliceCondition(.*)/,'get',()=>{
	return [
		{
			id:1,
			name:'Name1',
			font_height:12,
			font_size:'黑体',
			font_size_arr:[
				{
					"label": "Verdana",
					"value": "Verdana"
				}, {
					"label": "微软雅黑",
					"value": "微软雅黑"
				}, {
					"label": "宋体",
					"value": "宋体"
				}, {
					"label": "黑体",
					"value": "黑体"
				}, {
					"label": "楷体",
					"value": "楷体"
				},
			],
			number_format:1,
			number_format_arr:[
				{
					label:'科学计数',
					value:1,
				},
				{
					label:'科学计数2',
					value:2,
				},
				{
					label:'科学计数3',
					value:3,
				}
			],
			decimal:1,// 小数位数
			rotate:90.1,// 翻转角度
			show_Dz: true,// 显示等值线
			show_Bz:true,// 显示标注
		},
		{
			id:2,
			name:'Name2',
			font_height:12,
			font_size:'黑体',
			font_size_arr:[
				{
					"label": "Verdana",
					"value": "Verdana"
				}, {
					"label": "微软雅黑",
					"value": "微软雅黑"
				}, {
					"label": "宋体",
					"value": "宋体"
				}, {
					"label": "黑体",
					"value": "黑体"
				}, {
					"label": "楷体",
					"value": "楷体"
				},
			],
			number_format:2,
			number_format_arr:[
				{
					label:'科学计数',
					value:1,
				},
				{
					label:'科学计数2',
					value:2,
				},
				{
					label:'科学计数3',
					value:3,
				}
			],
			decimal:1,// 小数位数
			rotate:90.1,// 翻转角度
			show_Dz: true,// 显示等值线
			show_Bz:true,// 显示标注
		},
		{
			id:3,
			name:'Name3',
			font_height:12,
			font_size:'黑体',
			font_size_arr:[
				{
					"label": "Verdana",
					"value": "Verdana"
				}, {
					"label": "微软雅黑",
					"value": "微软雅黑"
				}, {
					"label": "宋体",
					"value": "宋体"
				}, {
					"label": "黑体",
					"value": "黑体"
				}, {
					"label": "楷体",
					"value": "楷体"
				},
			],
			number_format:3,
			number_format_arr:[
				{
					label:'科学计数',
					value:1,
				},
				{
					label:'科学计数2',
					value:2,
				},
				{
					label:'科学计数3',
					value:3,
				}
			],
			decimal:1,// 小数位数
			rotate:90.1,// 翻转角度
			show_Dz: true,// 显示等值线
			show_Bz:true,// 显示标注
		},
	]
})

/**
 * get 请求 等值线标注列表
 */
Mock.mock(/\/api\/getDzxListById(.*)/, 'get', () => {
	return Mock.mock({
		// 20条数据
		"data|20": [{
			//Id
			"id|+1": 1,
			"dz_line|1-10":1,
			//特征值
			"eigen_value|10-1000": 30,
			//标注序号★
			"bz_index|1-5": 1,
			//标注值★
			"bz_value|1-5": 1,
			//标注位置★
			"bz_position|1-5": 1,
		}]
	});
})

Mock.mock(/\/api\/modifySetting(.*)/, 'post', () => {
	return {
		status:200,
		message:'成功'
	}
})

Mock.mock(/\/api\/deleteSettings(.*)/, 'get', () => {
	return {
		status:200,
		message:'成功'
	}
})

Mock.mock(/\/api\/deleteDzLine(.*)/, 'get', () => {
	return {
		status:200,
		message:'删除成功'
	}
})
Mock.mock(/\/api\/saveBzValue(.*)/, 'post', () => {
	return {
		status:200,
		message:'修改成功'
	}
})
